#include<iostream>
#include"Tcpserver.hpp"
#include"Listener.hpp"
#include"Connection.hpp"
int main(int argc, char* argv[]){
    if(argc!=2){
        std::cout<<"Usage: "<<argv[0]<<" port"<<std::endl;
        return 1;
    }
    std::unique_ptr<Tcpserver> server(std::make_unique<Tcpserver>());
    std::shared_ptr<Connection> listener(std::make_shared<Listener>(std::stoi(argv[1])));
    server->Addconnection(listener);
    server->Loop();
    return 0;
}